#ifndef MCURSORSPLUGIN_H
#define MCURSORSPLUGIN_H

#include <KTextEditor/Plugin>
#include <QColor>
#include <QTextFormat>

namespace KTextEditor
{
	class View;
}

class MCursorsView;

class MCursorsPlugin
: public KTextEditor::Plugin
{
public:
	explicit MCursorsPlugin(QObject *parent = 0, const QVariantList &args = QVariantList());
	virtual ~MCursorsPlugin();

	static MCursorsPlugin* self()
	{ return plugin; }

	void addView (KTextEditor::View *view);
	void removeView (KTextEditor::View *view);

	void readConfig();
	void writeConfig();

	virtual void readConfig (KConfig *) {};
    virtual void writeConfig (KConfig *) {};

	void setCursorColor(const QColor& color);
	void setUnderlineStyle(QTextCharFormat::UnderlineStyle style);
	void setUnderlineColor(const QColor& color);

	QColor cursorColor() const
	{ return m_cursor_color; }
	QTextCharFormat::UnderlineStyle underlineStyle()
	{ return m_underline_style; }
	QColor underlineColor() const
	{ return m_underline_color; }

private:
	static MCursorsPlugin *plugin;
	QList<class MCursorsView*> m_views;
	QColor m_cursor_color;
	QTextCharFormat::UnderlineStyle m_underline_style;
	QColor m_underline_color;
};

K_PLUGIN_FACTORY_DECLARATION(MCursorsPluginFactory)

#endif
